﻿// ***********************************************************************
// Project			: Micua
// Assembly         : Micua.BLLFactory
// Author           : iceStone
// Created          : 2013-11-18 11:59
//
// Last Modified By : iceStone
// Last Modified On : 2014-01-05 10:46
// ***********************************************************************
// <copyright file="DAO.cs" company="Wedn.Net">
//     Copyright (c) Wedn.Net. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace Micua.Model
{
	[DataContract]
	[Serializable]
    public partial class Category : IEntity<Category>
    {

        #region ICloneable 成员
        /// <summary>
        /// 克隆一个对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            return MemberwiseClone();
        }
        #endregion

        /// <summary>
        /// 深度拷贝
        /// </summary>
        /// <returns>深度拷贝副本</returns>
        public Category DeepClone()
        {
            using (Stream objectStream = new MemoryStream())
            {
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(objectStream, this);
                objectStream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(objectStream) as Category;
            }
        }
        /// <summary>
        /// 浅度拷贝
        /// </summary>
        /// <returns>浅度拷贝副本</returns>
        public Category ShallowClone()
        {
            return Clone() as Category;
        }
    }

	[DataContract]
	[Serializable]
    public partial class Comment : IEntity<Comment>
    {

        #region ICloneable 成员
        /// <summary>
        /// 克隆一个对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            return MemberwiseClone();
        }
        #endregion

        /// <summary>
        /// 深度拷贝
        /// </summary>
        /// <returns>深度拷贝副本</returns>
        public Comment DeepClone()
        {
            using (Stream objectStream = new MemoryStream())
            {
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(objectStream, this);
                objectStream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(objectStream) as Comment;
            }
        }
        /// <summary>
        /// 浅度拷贝
        /// </summary>
        /// <returns>浅度拷贝副本</returns>
        public Comment ShallowClone()
        {
            return Clone() as Comment;
        }
    }

	[DataContract]
	[Serializable]
    public partial class CommentMeta : IEntity<CommentMeta>
    {

        #region ICloneable 成员
        /// <summary>
        /// 克隆一个对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            return MemberwiseClone();
        }
        #endregion

        /// <summary>
        /// 深度拷贝
        /// </summary>
        /// <returns>深度拷贝副本</returns>
        public CommentMeta DeepClone()
        {
            using (Stream objectStream = new MemoryStream())
            {
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(objectStream, this);
                objectStream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(objectStream) as CommentMeta;
            }
        }
        /// <summary>
        /// 浅度拷贝
        /// </summary>
        /// <returns>浅度拷贝副本</returns>
        public CommentMeta ShallowClone()
        {
            return Clone() as CommentMeta;
        }
    }

	[DataContract]
	[Serializable]
    public partial class Link : IEntity<Link>
    {

        #region ICloneable 成员
        /// <summary>
        /// 克隆一个对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            return MemberwiseClone();
        }
        #endregion

        /// <summary>
        /// 深度拷贝
        /// </summary>
        /// <returns>深度拷贝副本</returns>
        public Link DeepClone()
        {
            using (Stream objectStream = new MemoryStream())
            {
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(objectStream, this);
                objectStream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(objectStream) as Link;
            }
        }
        /// <summary>
        /// 浅度拷贝
        /// </summary>
        /// <returns>浅度拷贝副本</returns>
        public Link ShallowClone()
        {
            return Clone() as Link;
        }
    }

	[DataContract]
	[Serializable]
    public partial class Option : IEntity<Option>
    {

        #region ICloneable 成员
        /// <summary>
        /// 克隆一个对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            return MemberwiseClone();
        }
        #endregion

        /// <summary>
        /// 深度拷贝
        /// </summary>
        /// <returns>深度拷贝副本</returns>
        public Option DeepClone()
        {
            using (Stream objectStream = new MemoryStream())
            {
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(objectStream, this);
                objectStream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(objectStream) as Option;
            }
        }
        /// <summary>
        /// 浅度拷贝
        /// </summary>
        /// <returns>浅度拷贝副本</returns>
        public Option ShallowClone()
        {
            return Clone() as Option;
        }
    }

	[DataContract]
	[Serializable]
    public partial class Post : IEntity<Post>
    {

        #region ICloneable 成员
        /// <summary>
        /// 克隆一个对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            return MemberwiseClone();
        }
        #endregion

        /// <summary>
        /// 深度拷贝
        /// </summary>
        /// <returns>深度拷贝副本</returns>
        public Post DeepClone()
        {
            using (Stream objectStream = new MemoryStream())
            {
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(objectStream, this);
                objectStream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(objectStream) as Post;
            }
        }
        /// <summary>
        /// 浅度拷贝
        /// </summary>
        /// <returns>浅度拷贝副本</returns>
        public Post ShallowClone()
        {
            return Clone() as Post;
        }
    }

	[DataContract]
	[Serializable]
    public partial class PostMeta : IEntity<PostMeta>
    {

        #region ICloneable 成员
        /// <summary>
        /// 克隆一个对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            return MemberwiseClone();
        }
        #endregion

        /// <summary>
        /// 深度拷贝
        /// </summary>
        /// <returns>深度拷贝副本</returns>
        public PostMeta DeepClone()
        {
            using (Stream objectStream = new MemoryStream())
            {
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(objectStream, this);
                objectStream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(objectStream) as PostMeta;
            }
        }
        /// <summary>
        /// 浅度拷贝
        /// </summary>
        /// <returns>浅度拷贝副本</returns>
        public PostMeta ShallowClone()
        {
            return Clone() as PostMeta;
        }
    }

	[DataContract]
	[Serializable]
    public partial class Tag : IEntity<Tag>
    {

        #region ICloneable 成员
        /// <summary>
        /// 克隆一个对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            return MemberwiseClone();
        }
        #endregion

        /// <summary>
        /// 深度拷贝
        /// </summary>
        /// <returns>深度拷贝副本</returns>
        public Tag DeepClone()
        {
            using (Stream objectStream = new MemoryStream())
            {
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(objectStream, this);
                objectStream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(objectStream) as Tag;
            }
        }
        /// <summary>
        /// 浅度拷贝
        /// </summary>
        /// <returns>浅度拷贝副本</returns>
        public Tag ShallowClone()
        {
            return Clone() as Tag;
        }
    }

	[DataContract]
	[Serializable]
    public partial class User : IEntity<User>
    {

        #region ICloneable 成员
        /// <summary>
        /// 克隆一个对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            return MemberwiseClone();
        }
        #endregion

        /// <summary>
        /// 深度拷贝
        /// </summary>
        /// <returns>深度拷贝副本</returns>
        public User DeepClone()
        {
            using (Stream objectStream = new MemoryStream())
            {
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(objectStream, this);
                objectStream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(objectStream) as User;
            }
        }
        /// <summary>
        /// 浅度拷贝
        /// </summary>
        /// <returns>浅度拷贝副本</returns>
        public User ShallowClone()
        {
            return Clone() as User;
        }
    }

	[DataContract]
	[Serializable]
    public partial class UserMeta : IEntity<UserMeta>
    {

        #region ICloneable 成员
        /// <summary>
        /// 克隆一个对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            return MemberwiseClone();
        }
        #endregion

        /// <summary>
        /// 深度拷贝
        /// </summary>
        /// <returns>深度拷贝副本</returns>
        public UserMeta DeepClone()
        {
            using (Stream objectStream = new MemoryStream())
            {
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(objectStream, this);
                objectStream.Seek(0, SeekOrigin.Begin);
                return formatter.Deserialize(objectStream) as UserMeta;
            }
        }
        /// <summary>
        /// 浅度拷贝
        /// </summary>
        /// <returns>浅度拷贝副本</returns>
        public UserMeta ShallowClone()
        {
            return Clone() as UserMeta;
        }
    }

} 
